package com.acme.task3;

public class Task3Arrays {
    public static final String DIVIDED_3 = " is divided by 3";
    public static final int N = 40;

    public static void main(String[] args) {
        for (int i = 1; i <= 50; i++) {
            if (i % 3 == 0) {
                System.out.println(i + DIVIDED_3);
            }
        }
        int[] array = new int[N];
        for (int i = 1; i <= N; i++) {
            array[i - 1] = i;
        }
        System.out.println(avg(array));
    }

    public static double avg(int[] array) {
        double sum = 0;
        for (int i : array) {
            sum += i;
        }
        return sum / array.length;
    }
}
